package com.yanfan.maintain.controller;

import com.yanfan.common.core.controller.BaseController;
import com.yanfan.common.core.domain.AjaxResult;
import com.yanfan.iot.domain.Device;
import com.yanfan.maintain.service.IMiniAppApiService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.Map;

@RestController
@RequestMapping("/maintail/miniapp-api")
public class MiniAppApiController extends BaseController {

    @Autowired
    private IMiniAppApiService miniAppApiService;

    @GetMapping("find-maintail-device-count")
    public AjaxResult findMaintailDeviceCount(Device device) {
        Map<String, Object> result = miniAppApiService.findMaintailDeviceCount(device);
        return AjaxResult.success(result);
    }

    @GetMapping("find-maintail-todo-count")
    public AjaxResult findMaintailTodoCount() {
        Map<String, Object> result = miniAppApiService.findMaintailTodoCount();
        return AjaxResult.success(result);
    }
}
